# $Id$
# Maintainer: Eric Bélanger <eric@archlinux.org>

pkgname=vorbis-tools
pkgver=1.4.0
pkgrel=6
pkgdesc="Extra tools for Ogg-Vorbis"
arch=('i686' 'x86_64')
url='http://www.xiph.org/vorbis/'
license=('GPL2')
depends=('libao' 'libvorbis' 'curl' 'flac')
source=(http://downloads.xiph.org/releases/vorbis/${pkgname}-${pkgver}.tar.gz
	vorbis-tools-cve9638-cve9639.patch vorbis-tools-cve9640.patch
	vorbis-tools-CVE-2015-6749.patch)
sha1sums=('fc6a820bdb5ad6fcac074721fab5c3f96eaf6562'
          '307f4f5f20596e47fbed733bd2918c31549736a7'
          'ef99371b600740f5984b19ccb515f0cb1acb1af4'
          '1c9b794394f0dd2bec289c2d11f58cf100d5c572')

prepare() {
  cd ${pkgname}-${pkgver}
  patch -p1 -i "${srcdir}/vorbis-tools-cve9638-cve9639.patch"
  patch -p3 -i "${srcdir}/vorbis-tools-cve9640.patch"
  patch -p1 -i "${srcdir}/vorbis-tools-CVE-2015-6749.patch"
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr --without-speex --enable-vcut
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
}
